<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>componentz组件</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <my-header></my-header>
    </div>
    
    <script>
        // 全局模板
        let myHeaderChild = {
            template: '<p>this is my header child</p>',
        }

        let myHeader = {
            template: '<p> <my-header-child></my-header-child>  this is my header</p>',
            components: {
                'my-header-child': myHeaderChild
            }
        }

        new Vue({
            el: '#app',
            data: {
                message: '哈喽'
            },
            components: {
                'my-header': myHeader
            }
        })
    </script>
</body>

</html>